<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 1200px;
            margin: 0 auto;
        }
        .box .header,.footer{
            height: 100px;
            width: 1200px;
            background-color: springgreen;
            font-size: 80px;
            text-align: center;
            line-height: 100px;
            color: #fff;
        }
        ul,li{
            list-style: none;
        }
        ul{
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
        }
        ul > li{
            width: 280px;
            height: 500px;
            border: 1px solid gray;
            margin-top: 10px;
        }
        img{
            width: 280px;
            height: 350px;
        }
        ul>li>p{
            padding: 0 10px;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="header">头部</div>
        <div class="content">
            <ul>
                <li>
                    <img src="" alt="">
                    <p>2020西太湖国际应跃进</p>
                    <p>城市:常州</p>
                    <p>地址:常州席太平个地方回家看电视</p>
                    <p>价格:23323</p>
                    <p>演出时间:2022</p>
                </li>
            </ul>
        </div>
        <div class="footer">尾部</div>
    </div>
    <script src="./dm_list.js"></script>
    <script>
        var ul = document.querySelector("ul")
        /* 
            //1.编写静态页面
            //2.获取数据
            //3.使用JS来渲染视图
                //数组当中有一个个,渲染多少个li
        */
        //遍历数组
        var str = ""
        list.forEach(function(item){
            str+=`
                <li>
                    <img src="${item.pic}" alt="">
                    <p>${item.name}</p>
                    <p>城市:${item.city}</p>
                    <p>地址:${item.address}</p>
                    <p>价格:${item.price}</p>
                    <p>演出时间:${item.showTime}</p>
                </li>
            `
        })
        // console.log(str);
        // console.log(list);
        //渲染视图
        ul.innerHTML = str;
    </script>
</body>
</html>